package com.reform.service;

import com.reform.pojo.project.PhaseTime;
import com.baomidou.mybatisplus.extension.service.IService;
import com.reform.res.Result;

import javax.servlet.http.HttpServletRequest;
import java.sql.SQLException;
import java.util.List;

/**
 * <p>
 * 阶段时间表 服务类
 * </p>
 *
 * @author mortale
 * @since 2021-07-15
 */
public interface IPhaseTimeService extends IService<PhaseTime> {
    /**
     * @param phaseTime
     * @return
     * @throws SQLException
     */
    Integer creatPhaseTime(PhaseTime phaseTime) throws SQLException;

    /**
     * @param phaseTime
     * @return
     */
    Integer updatePhaseTime(PhaseTime phaseTime) throws SQLException;

    /**
     * @param batch_id
     * @return
     * @throws SQLException
     */
    Integer deletePhaseTime(String batch_id) throws SQLException;

    /**
     * 创建中期检查
     *
     * @param phaseTime
     * @return
     */
    Result creatBatchPhase(PhaseTime phaseTime);

    /**
     * 通过id获取阶段检查信息
     *
     * @param phaseId
     * @return
     */
    Result getPhaseById(String phaseId);

    /**
     * 编辑阶段检查
     *
     * @param phaseTime
     * @return
     */
    Result updatePhase(PhaseTime phaseTime);

    /**
     * 删除阶段信息
     *
     * @param phaseId
     * @return
     */
    Result deletePhaseById(String phaseId);

    /**
     * 获取所有阶段检查信息
     *
     * @return
     */
    Result getAllPhase();

    /**
     * 获取待办事项
     *
     * @param type
     * @return Result
     */
    Result getNeedDealtPhase(HttpServletRequest request, Integer type) throws SQLException;

    /**
     * 更改批次状态
     * @param status 状态
     * @return
     */
    Result updateBatchStatusById(String batchId, Integer status);

    /**
     * 通过类型获取阶段id
     * @param type
     * @return
     */
    List<String> getPhaseIdByType(int type);

    Result getNeedDealt(String gh, Integer type) throws SQLException;

    /**
     * 更改打分表
     * @param batchId 批次id
     * @param scorePath 打分表路径
     * @param scorePathName 打分表文件名
     * @return Result
     */
    Result updateScore(String batchId, String scorePath, String scorePathName);

    /**
     *
     * @param phaseId
     * @param status
     * @return
     */
    String getPhaseIdByStatus(String phaseId, int status);
}
